Fix build with automake 1.13
Fix build with -Werror=format-security and add missing include