Fix libm missing link error by adding -lm