Repair static build functionality
Prefer static build on windows