You will need to compile maxima from source to install on an older Ubuntu distribution. You can download the source tarball from sourceforge and execute
./configure
make
sudo make install
However, this usually makes many admins nervous about upgrading or removing all the pieces. It will probably also complain about missing dependencies that you will need to resolve.
Alternatively you may try to build a Debian package to install will the package manager. Fortunately Maxima 5.38.1 is included in the Ubuntu 17.04 repository so you can use that for a start. First add the following lines to /etc/apt/source-list
deb-src http://us.archive.ubuntu.com/ubuntu/ zesty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ zesty-updates universe
then execute sudo apt-get update
cd ~
apt-get source gcl
apt-get source maxima
to add the source repositories and download the sources to your home directory. You have to compile and install GCL first because the version in 16.04 is to old for the maxima package. So
cd ~/gcl-2.6.12
sudo apt-get build-dep gcl
dpkg-buildpackage -rfakeroot -uc -b
You may pour a beer or brew some coffee while the last line completes. It should be done after the coffee is ready, but before a Pils. When it is complete there should be two new .deb files in ~. Install with dpkg -i gcl_*.deb. Then you can enjoy your beverage while you compile the maxima package.cd ~/maxima-5.38.1
sudo apt-get build-dep maxima
dpkg-buildpackage -rfakeroot -uc -b
dpkg -i ~/maxima_*.deb
Then it should be time to configure and test STACK again.