$OpenBSD$

Index: libextl/system-autodetect.mk
--- libextl/system-autodetect.mk.orig
+++ libextl/system-autodetect.mk
@@ -79,6 +79,13 @@ LUA_INCLUDES=`pkg-config --cflags lua5.1`
 LUA=`which lua5.1`
 LUAC=`which luac5.1`
 
+else ifeq (5.1,$(findstring 5.1,$(shell pkg-config --exists lua51 && pkg-config --modversion lua51)))
+
+LUA_LIBS=`pkg-config --libs lua51`
+LUA_INCLUDES=`pkg-config --cflags lua51`
+LUA=`which lua51`
+LUAC=`which luac51`
+
 else ifeq (5.1,$(findstring 5.1,$(shell pkg-config --exists lua && pkg-config --modversion lua)))
 
 LUA_LIBS=`pkg-config --libs lua`
