Change link order to fix linker issues