You are having problems installing software but you do not show us what you are doing. You are just showing the output of some command and we are left guessing.
If you are new to FreeBSD but previously have been used to working on a GNU sytem (Linux) there are some subtle but important differences.
A typical stumbling block when compiling your own programs is make. BSD has a nice make but it is not the same as GNU make. If you want to use GNU make then you will install it. But when using it make is still BSD make but now you have a gmake as well. This can be confusing.
It is the same thing with m4 as FreeBSD has it in the base system.
$ which m4
/usr/bin/m4
But writing that you are installing gnu m4-1.4.18 is not helpful as many roads lead to Rome. Are you installing the package/port or from source?
FreeBSD Package
The most simple way of installing software on FreeBSD is to install the package. Packages are precompiled binary distributions of the ports.
pkg install m4
You are probably not doing this. But this is the easy route.
FreeBSD Port
A FreeBSD port is a collection of patches and whatnot needed to get an application running on FreeBSD. If you have the ports tree installed you would change the directory to devel/m4 and make (compile) the application.
The ports tree is targetting BSD make. Hence it is important to use BSD make and not GNU make. The fun part is that m4 depends on autoconf which in turn depends on GNU make.
But for our purpose we will use BSD make:
$ make
$ sudo make install
An advantage of using ports is that you can change the compile time settings using make config. But in most cases with GNU autotools and friends the defaults will usually suffice and the binary package is all you need.
Source install
My guess is that you are trying to install from source. In that case it is important to know the differences between the GNU and BSD tools which often are named the same. But the GNU tools tend to expect you to be using GNU tools. And if you have a vanilla FreeBSD install then you already have make and m4 but the BSD variants.
So when the GNU instructions say make you should make sure you have GNU make installed and are typing gmake at the command line.
Unless you want to learn these intricacies I will recommend that you stick to packages. If you want to continue down this route you need be more verbose in your questions and show us what you are doing. Without this information we are left guessing.
Update
From reading the comments it seem that the root cause is trying to install Apache APR. This is avaiable in FreeBSD ports as well. At the time of writing the latest port version of APR is 1.6.3 which is in sync with what Apache thinks is the latest stable version.
On new vanilla FreeBSD systems it will then be as simple as typing:
pkg install apr1
If the binary package servers have not caught up yet you can choose to build it yourself. In that case you may change the defaults as well. You do that using the ports tree. Use the portsnap tool to make sure the tree is up-to-date.
If you have no ports tree then:
# portsnap fetch
# portsnap extract
If you just need to update:
# portsnap fetch update
Then:
# cd /usr/ports/devel/apr1
# make config
# make
# make install