pass -rpath to the linker in a (hopefully) more crossplatform-friendly way. fixes #1921