As someone else just wrote, you can use royal icing. You can even add some cocoa to dye the icing brown so it blends in with the gingerbread better.
Some other icing options would be more invisible also: I sometimes glue my walls together with melted chocolate rather than icing. You can buy chocolate candy melts that match the color of your gingerbread cookies and the cracks will be virtually invisible (especially after decorating). Melted sugar glue is another option. See the "Sugar Glue" note at the bottom of the icing recipes page on this site.