Don't check for libdl if we are going to use dlfcn.c
Try to make dlfcn work for mingw32.
Remove the symlinks -- they will be used incorrectly on non-mingw builds.
Use dlfcn-win32 on windows.
Fix use of M_PI for e.g. mingw.
Guard dlfcn.h header with extern "C"
Always mention std::isnan instead of just isnan to be portable.