Improve makefile to correctly track subdirectories dependencies

Change the standard build to use dynamic linking to Lua libraries
Improve Makefiles organization