[build] more build fixes on windows

for --disable-static which makes a lot of sense on windows.
See also PR #1139