Fix static linking builds