Consider using kerl to build and manage Basho's Erlang.
This build will take some time, and the output should end up looking something like this:
$ kerl build git https://github.com/basho/otp.git OTP_R16B02_basho10 R16B02-basho10
Checking Erlang/OTP git repository from https://github.com/basho/otp.git...
Building Erlang/OTP R16B02-basho10 from git, please wait...
DOCUMENTATION INFORMATION (See: /home/sutt/.kerl/builds/R16B02-basho10/otp_build_git.log)
* documentation :
* fop is missing.
* Using fakefop to generate placeholder PDF files.
Erlang/OTP R16B02-basho10 from git has been successfully built
Install Erlang R16B02:
$ kerl install R16B02-basho10 ~/.kerl/installs/R16B02-basho10/
Installing Erlang/OTP git (R16B02-basho10) in /home/sutt/.kerl/installs/R16B02-basho10...
You can activate this installation running the following command:
. /home/sutt/.kerl/installs/R16B02-basho10/activate
Later on, you can leave the installation typing:
kerl_deactivate
Activate it, and verify that it is activated:
$ . /home/sutt/.kerl/installs/R16B02-basho10/activate
$ kerl active
The current active installation is:
/home/sutt/.kerl/installs/R16B02-basho10
Git clone the Riak code:
git clone https://github.com/basho/riak.git
cd riak
Optional: switch to a tag:
git checkout -q tags/riak-2.2.0
With Erlang R16B02-basho10 active you should be able to run make.
You can simply compile:
make
Or you can make an Erlang Release:
make rel
A development release (for testing):
make devrel DEVNODES=$(nproc)
Or a package specific to your OS (.deb):
make package
See if this has better results for you.