Fix linking static build