Building blender headless on Ubuntu 20.04.5 LTS fails: sig_handle_blender_esc undeclared

Hi, I’m trying to build blender headless on Ubuntu 20.04.5 LTS following the general documentation. All dependencies are installed and after executing make headless it builds until:

[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o

Then it stops with the following error message:

/home/user/blender-git/blender/source/creator/creator_signals.c: In function ‘main_signal_setup_background’:
/home/user/blender-git/blender/source/creator/creator_signals.c:248:18: error: ‘sig_handle_blender_esc’ undeclared (first use in this function)
  248 |   signal(SIGINT, sig_handle_blender_esc);
      |                  ^~~~~~~~~~~~~~~~~~~~~~
/home/user/blender-git/blender/source/creator/creator_signals.c:248:18: note: each undeclared identifier is reported only once for each function it appears in

Any ideas/comments on how to fix this are appreciated.