Add Makefile logic to ease compilation against luajit

Taken from lextlib