Fix static builds on darwin