CMakeLists: Fix detection of libm

Only use libm on Unix and Unix-like systems, except for Apple (where
it's unnecessary), and BeOS and Haiku (where it's unavailable).

Avoid searching for libm at explicit locations. They may be incorrect,
especially for cross-platform builds.
1 file changed