fix pthread linking issue for 'make check' for flint (wrong link order)