fix --with-luajit build

Should fix #25880.