Use AC_USE_SYSTEM_EXTENSIONS instead of redefining _XOPEN_SOURCE
Include <iostream> in util.hh

util.hh uses std::istream, so make sure it is defined