Detect ffi

Since the makefile relies on pkg-config, we might as well use it to query if libffi is installed or not.