cmake: check for math library functions even in the absence of libm (Reference issue: https://github.com/libsdl-org/SDL/issues/7011)