Error trying to compile LibreOffice 4.2.8.2 from source on Ubuntu Server 18.04

I have the need to install LibreOffice 4.2.8 on Ubuntu Server 18.04 to make it work with a software.
I downloaded the source tarball from here, and I’m following this guide to build LibreOffice.
The first command I gave was the following:

./autogen.sh --with-distro=LibreOfficeLinux --with-package-format=deb --enable-epm --without-krb5 --without-gssapi --disable-gconf --disable-gstreamer-0-10 --disable-kde

And after that I used the

make

command to build from source.
Now my problem is that when I use the make command, I get the following error and I can’t solve it by myself.

Pastebin with log

I don’t think that someone would be able to help you with building a version from late 2014 today…

… and, in addition to Mike’s, this is probably not the right place to ask. It is a questions and answers site about using LibreOffice. Go to the developers mail list.

… which is LibreOffice Info Page

Why do you need to build it? Why not download and use it? Archive is Index of /libreoffice/old

possibly he want use LO without UI for document converting on his server?

Thank you Regina, I’ve installed the .deb packages.
For future reference, on Ubuntu 18, Libreoffice also needs libdbus-glib-1-2 and openjdk-8-jdk