fix mingw headless linking (thanks cleanrock!)