2 problems I'm seeing immediately
First, you're not using the proper build command for MinGW, you're using the Linux GCC build command, which is requiring libraries that don't exist in MinGW.
Instead try something like this:
g++ -o olcExampleProgram.exe olcExampleProgram.cpp -luser32 -lgdi32 -lopengl32 -lgdiplus -lShlwapi -ldwmapi -lstdc++fs -static -std=c++17
Second, you're likely using a bad version of MinGW.. Long story short, not all MinGW are created equal and currently, the best version (and the one that has been tested to compile PGE applications) is the version provided by MSYS2.
If you want you can check the PixelGameEngine WIKI page on the subject.
https://github.com/OneLoneCoder/olcPixelGameEngine/wiki/Compiling-on-Windows-with-Other-Compilers