added linker flags -lm and -ldl