Use -Wl to specify -rpath correctly.
Add missing -Xlinker to order test.

Both the parameter itself and the argument to the parameter must be prefixed
with -Xlinker so that they are passed properly.