Fixed an incompatibility with current gcc on ubuntu, related to the ordering of linker arguments