Only link with libm (-lm) if necessary.

This fixes warnings when building with MSVC.
2 files changed