Tweak include/lib dir detection in ffi.py

Joint work with @carlosmn