I use CentOS 7, and have used Ubuntu before.
I haven't had this issue at all, and recompiled to check again.
I know I have somewhat been in contact with the issue before, but I can't remember thoroughly where.
Newer version of Bitcoin source code have changed to full path, so probably others have encountered the same issue.
By the way, if you wanna talk more interactively you can join the Joulecoin Discord channel:
https://discord.gg/RaWB3uEAnd send me a private message.

In my experience, the issue only happens with newer g++ ( Currently building with 7.3.0 as 8.x.x will not build db4.8 without a patch, and I like consistency across coin builds).
By a stroke of luck, I just got discord working in bitlbee/weechat yesterday. Will join at some point today. Thanks!