The Msys2 devs dont want it since they are deprecating win32 but for those of us who still use 32 bit sometimes this fixes the build.
the problem as noticed by others is that windres on 32 bit mingw gets passed -mthreads via the WX_CXXFLAGS flag.
changed it to WX_CPPFLAGS as both return the same minus the -mthreads flag.