I ran into the same problem and I fixed it by adding an -rpath in my Makefile.config :
LINKFLAGS := -Wl,-rpath,$(HOME)/anaconda/lib
I think this is the correct fix because it (-rpath) tells GCC where it can find libraries (libjpeg, libpng) that other libraries (in this case opencv) depend on.