configure.ac: fix libm checks (Trac Trac #3730)
libbfd pulled libm as dependency and broke LIBM= detection.
Patch moves libm in library tests as early as possible.
Thanks to asuffield for suggesting such a simple fix.
Thanks to Roie Kerstein and Renato Gallo for finding
and tracking down the issue.