use -std=gnu++11 only on mingw, c++11 otherwise [fixes #2564]