The original MinGW doesn't support multithreading, but almost nobody uses the original MinGW those days. (Other than newbies that don't know better.)
Prefer MinGW-w64, which does support it. You can install it from MSYS2, or https://winlibs.com/, or some other place.