add check for -lm
use -lm if needed