build: change lib order to fix build on netbsd