Fix build with automake 1.13
Fix build with glibc >= 2.16
Fix build with -Werror=format-security