I keep my experiences on compiling in this blog post, the compilation is the standard ./configure && make. The resolutions listed here is for Fedora.

Error
checking for GTK... configure: error: GTK+-2.8 is required to compile gtk-engines
Resolution
gtk2-devel package is not installed or too old.

Error
configure: error: No C++ compiler found
Resolution
gcc-c++ package is not installed.

Error
$ make
[snip]
gcc "-Wall" "--std=c99" "-Os" "-s" -o ".pm-cache/34-1-utils" ".pm-cache/1-utils.o" ".pm-cache/2-main.o" ".pm-cache/3-lua.o" ".pm-cache/4-word.o" ".pm-cache/5-bit.o" ".pm-cache/6-screen.o" ".pm-cache/32-31-7-_prologue.o" ".pm-cache/33-dpy.o" "-lm" "-lncursesw" "-llua5.1"
/usr/bin/ld: cannot find -llua5.1
Resolution
If you are sure you have installed the library, then this is usually caused by the different naming (convention) of /usr/lib[64]/*.so on different distributions or you are compiling on x86_64 but the compiling script find the wrong directory for *.so and can't find a such name (If found, the error message should be about ELF Class is not compitable). You may need to open Makefile and change -llua5.1 to -llua whereever you find.