Improve build on BSD.