use LIBM instead of -lm as per mtaylor review