Thanks for the tip, GNUser!
For posterity: If you pass --lua-version 5.1 to Luarocks, it will find LuaJIT just fine. You need to pass this option while configuring LuaRocks and installing the module (luasocket in this case), because LuaRocks has a separate configuration for each Lua version.
Where I stumbled: in addition to luajit, compiletc, and luarocks, you need to tce-load luajit-dev, which will put Lua's header files (lua.h, lauxlib.h, etc.) at /usr/local/include/luajit-2.0. No hacks required, once that's done it should just work.