It looks like the mingw that sysprogs offers for download and that we use to try to compile qmake on windows does not come with knownfolders.h.
I manually copied knownfolders.h and winapifamily.h from the Qt mingw to the include dir of the sysprogs mingw and added #include “Knownfolders.h” to qsettings.cpp. It went a bit further but ultimately failed again during compiling so I guess a bit more is missing.
To me it looks like sysprogs needs to include more header files to be able to compile 5.8 out of the box.