fix makefile to build static lib
fix socket so it can be loaded statically; see http://lua-users.org/lists/lua-l/2010-07/msg00840.html