autogen.sh: improve dependency parser

Signed-off-by: Jakub Filak <jfilak@redhat.com>