refactor
fix memory leak
luajit requires explicit 'dl' linkage
-O3 -> -O2
CLOCK_MONOTONIC_RAW -> CLOCK_MONOTONIC (no CLOCK_MONOTONIC_RAW on debian 6)