Add build dependency discovery to autogen.sh

Copypasta'd libreport autogen.sh so that we can install build
dependencies the same way for all three projects.

Signed-off-by: Martin Milata <mmilata@redhat.com>