Fix compile errors under mingw-w64.

To be included in PR #7626.
Apply the main CXXFLAGS to `make json-check`.

In particular, do apply --std=c++11 to chkjson, but including the rest
of the flags shouldn't hurt.