It's using LIBS instead.  I think the idea is to use `lib` when you know the name of the lib ("ffi" means you mean libffi...) and `LIBS` is used when you are using linker flags to specify the name of the lib (`-L/somewhere -lffi` for example), which is the format that pkg-config provides.