fix -lm linking issue that arises on Ubuntu