Added check for libm, which was missing.