libjpeg installed and linked but not found when install other libraries

I am using Mac OSX 10.14 The error message I got when installing HDF4 library ( is

ld: library not found for -ljpeg

I have tried:

brew update brew install libjpeg brew unlink libjpeg brew link libjpeg

also tried: xcode-select --install

also tried: git clone ./configure make make instal...

All of the above are successful, but I still cannot get rid of the same error message when installing other libs that requires libjpeg (ld: library not found for -ljpeg).