re-enable static only builds

Not sure if this is the correct solution, but it did fix static only builds for me. Happy to make whatever changes you suggest.