I got Doxygen version 1.9.6 (6bc5f864d0c847a74944d6e9e4a42346e8c18b28) to build using the following instructions on Ubuntu 18.04.
sudo apt-get install graphviz bison flex
git clone https://github.com/doxygen/doxygen.git
cd doxygen
mkdir build
cd build
cmake -G "Unix Makefiles" ..
# Default installation at /usr/local/bin/doxygen
sudo make install