Fix out of source static build