Support building on kfreebsd

Add the build system code to support kfreebsd.