In these old but still supported versions of Ubuntu, the version of gcc is too old to compile Aevol.
Probably the easiest way to get a recent compiler on these versions of Ubuntu is to upgrade to a newer package repository.
You can achieve this with the following commands:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old # Make a backup of configsudo sed -i -e 's/focal/noble/g' /etc/apt/sources.list # Update package repository