[build] Fix building on FreeBSD