FreeBSD compatibility patch and Makefile paths correction