Add missing sys/stat.h include.

This include is needed on older glibc versions to find "struct stat"

Signed-off-by: Olaf Kirch <okir@suse.de>
Define -D_GNU_SOURCE when compiling code that uses O_CLOEXEC

Signed-off-by: Olaf Kirch <okir@suse.de>
minor cleanup of library makefile

Signed-off-by: Olaf Kirch <okir@suse.de>
Merge branch 'build-fixes' of https://github.com/okirch/twopence