Rearranged linker flags for test suite.

Some linkers (GNU ld) are picky about library order, so if we import libraries as part of our LDFLAGS then that needs to come after any DYLIB_NAME which might require that library.