In order to use the C code in these directories, you should first modify / setup the file config/LocalMakefileConfig.mk, which is included by the main Makefiles and allows you to overwrite the settings from config/Makefile.mk. Once this is done, run make. You must then use the install targets to copy / link the resulting shared libraries with their full paths into the "luatex/lib" subdirectory of the directory where your TeX executable resides. For instance, if the luatex program is in /usr/texbin then you would put SimpleDemoC.so into /usr/texbin/lib/luatex/lua/pgf/gd/examples/c Due to bugs in the LuaTeX code, you currently need to append the paths of the libraries to their name as done in the Makefiles. Note that, currently, the Makefile will link the Lua library statically into the shared graph drawing library (at least on MacOS). This is conceptually wrong and, indeed, a lot of effort was need to avoid having LuaTeX crash on a TeX run because of two Lua libraries being used simultaneously. It works, but hopefully, in the fututure, this will be fixed.