libevent needs to link the mathlib, so we add -lm