fixed linking with system libs, made rpath munging an option #869