Add Mingw support (tune libraries and disable cpuid with #ifdef)

As promised, here is the patch for basic mingw-64 compiler compatibilty.
Tested on http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/ , version 4.7.3

Compatible only with posix-threads-emulating releases (esewhere, no std::mutex)

Necessary changes:
 - Mingw have conflicting cpuid.h and intrin.h, so cpuid was disabled by ifdef.
 - Mingw did not have M_PI and WIN32 macro available
 - Mingw library finding is slow and tricky, It needs explicit specification for ``openmp`` (used by stxxl?) and ``winsock`` (for boost_asio). It also wants to see "using" library before "used", so luabind and lua was interchanged.

For normal compilers it is, but not for mingw :) No M_PI (and no macro to safely enable it) and no WIN32. 
It has _WIN32, maybe it is better to use it instead of WIN32 in all the code.  https://www.mail-archive.com/bug-gnulib@gnu.org/msg05722.html