Index: config
--- config.orig	2021-12-27 20:15:56.339754000 +0100
+++ config	2021-12-27 20:16:54.371534000 +0100
@@ -9,8 +9,7 @@
 LUA_LIBDIR= $(PREFIX)/lib/lua/$(LUA_VERSION)
 
 # Lua includes directory
-LUA_INC += -I$(PREFIX)/include
-LUA_INC += -I/usr/include/lua$(LUA_VERSION) -I/usr/include/lua/$(LUA_VERSION)
+LUA_INC += -I$(PREFIX)/include/lua -I$(PREFIX)/include
 
 # OS dependent
 LIB_OPTION= -shared #for Linux
@@ -20,7 +19,7 @@
 MACOSX_DEPLOYMENT_TARGET= 10.5
 
 # Compilation directives
-WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
+WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
 INCS= $(LUA_INC)
 CFLAGS= $(WARN) $(INCS)
 CC= gcc
Index: Makefile
--- Makefile.orig	2020-04-23 03:16:42.000000000 +0200
+++ Makefile	2021-12-27 20:22:09.155632000 +0100
@@ -12,7 +12,7 @@
 lib: src/lfs.so
 
 src/lfs.so: $(OBJS)
-	MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET); export MACOSX_DEPLOYMENT_TARGET; $(CC) $(LIB_OPTION) -o src/lfs.so $(OBJS)
+	MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET); export MACOSX_DEPLOYMENT_TARGET; $(CC) $(LIB_OPTION) -o src/lfs.so $(OBJS) -llua
 
 test: lib
 	LUA_CPATH=./src/?.so lua tests/test.lua
