Various build fixes for using waf and mingw

https://build.opensuse.org/package/show/home:e9925248:mingw/mingw32-jack