Clang build fixes

Required to build master on FreeBSD, along with disabling automake -Werror and providing following in CPPFLAGS: ```-Dopen64=open -Dftruncate64=ftruncate -Dlseek64=lseek``` (standard functions work with 64bit offsets out of box on FreeBSD, so no *64 counterpares are needed/available).