Fix tests build by adding -lm flag