Based on the GraphicsMagick oss-fuzz build, the dependencies declared by pkg-config for libheif are sufficient to statically link for all dependencies except for vvdec and vvenc. That is pretty good.
What is not good is that if vvdec and vvenc are not included in the build, using the option -DWITH_EXAMPLES=on still fails to link in a static build. It is observed that none of the declared build dependencies except for libheif itself are applied. This could only work if libheif is a shared library, and all involved shared libraries have correct implicit dependencies.
While the examples are not worthy of fuzz-testing, it is useful to build them in the oss-fuzz environment (or some other static build, or build lacking sufficient implicit dependencies) in order to be used as a reference when testing by hand.