Add a flag to link the rts when linking a dynamic library
When linking a dynlib that is meant to be loaded and used with
dlopen and friends you have to explicitly add a
-lHSrts-ghc$GHC_VERSION flag to the ghc invocation (see
T3807 for an example) for the dynlib to be useable. This is cumbersome because it requires you to know the GHC version as well as the naming convention for for the different flavours of the GHC rts.
Add a flag to link the RTS library similarly to what we do for (dynamic) executables, taking into account the various flags to specify the RTS flavour to use (