test: Fix run-make on windows

Fixes #12303.

Also contains a partial fix for `make check` failure.