A patch for Lazarus would be the ideal solution. How to make it? What pulls in the dependency? I don't even know what appmenu-gtk2 does.
I suspect the solution is to use GTK3, its not a 'patch to GTK2 issue'.

What this library does is take the GTK2 way of describing menu entries for an app and turn them into a DBus compliant equivalent, sends the relevent data up via DBus to the Desktop. But it seems to be more than 'just' dealing with menu entries because its loaded at run time even when the app has not been started with a menu click. Might allow, for example, the icon to show on a Dock or right click to add it to 'favourites'. I have used strace on both Lazarus and my app, tomboy-ng, and both do try to load libappmenu-gtk2 at startup. If its not present, they appear to fail silently and, sometimes, go into this freeze state.
We could take the approach that its a Ubuntu bug, GTK2 should be dependent on appmenu-gtk2. Its there in older systems that are more supportive of GTK2 and its small and does no harm. But whether we can interest Ubuntu in changing something they wish to see the end of, I don't know.
I think our only solution right now is to
* get it mentioned in the Lazarus Deb's dependencies.
* Mention it on the wiki for people building Lazarus from source
* Mention, repeatedly, that if you distribute a Lazarus app it probably is dependent on appmenu-gtk2.
* Nag Ubuntu to add it to GTK2's list. Almost certainly won't change U19.10 but maybe the LTS U20.04 ?
Chris and I will watch the forum, Juha, can you trigger an addition to the Lazarus Deb's dependencies list ?
EDIT: Note that Fedora does not have anything like appmenu-gtk2, that says its one of those things Ubuntu add to make their OS a bit friendlier. Fedora are happy to say, "you are not keeping up, goodbye!".
Davo