Fix the -lm configure test; fixes #4155