while extern/libtommath/makefile.shared contains this
So LIBTOOL ends up being defined, but empty, meaning that all attempts to use it fail.
The problematic line in gen/Makefile comes from builds/posix/Makefile.in and was added to it by 78376b0 seemingly accidentally, as it doesn't bear any relationship to the commit message. AFAICS the first chunk of this commit should be just reverted, which would fix the problem. Alternatively, fix extern/libtommath/makefile.shared to use ifeq($(LIBTOOL),) instead of checking if it's defined.
Note that this commit is in 3.0 branch only, so it doesn't affect master/4.0.