Check for, and use libm

Both the library and the examples make use of math primitives, and we need to explicitly link against libm.