Some notes:
pkg-config is needed for proper compilation of libheif, otherwise finding packages will result in errors. This happens on "automake" configure and cmake (internal/external) builds. At least on OSX adding libraries as suggested on configure --help would find the libs but produce errors on Compiling. Ignoring errors by editing CFLAGS to allow compilation will fail on linking.
pkg-config is just easier.
Dependencies for libheif
libheif depends on