For anyone building TVH from Github latest master I just managed to successfully build 4.2-2059 without any additional settings.It appears that this commit
https://github.com/tvheadend/tvheadend/commit/c0f616e56bc4df70978a060b72f8c6a7ca487d3f blew the build process out of the water,certainly for building on Ubuntu 22.04 LTS x86_64 using compiler gcc (Ubuntu 11.3.0-1ubuntu1~22.04) which is standard from the Ubuntu repository. Not quite sure how this commit escaped under the radar but the commit author has now put things right with his latest commit.