Portability fixes,  with these changes I am able to build liblightgrep on FreeBSD.
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'upstream/master'
Merge branch 'master' of https://github.com/ant1/liblightgrep