On my system gnucash uses glib2. The dependency is coded as >=2.4.0, but I have 2.14.3 as well. I would look at config.log as the error suggests; there's probably some reason why the test program failed other than glib2 not being installed.