Some fixes so that libm can be used instead of libopenlibm with USE_SYSTEM_LIBM=1