test: define and use `%target-rpath`
Create a new capturing substitution for adding a rpath to a target
library. This is needed as Windows doesn't really support the concept
of a rpath. This also makes it possible to remove the parameter from
the command line on windows.