Note: I\'m not so good at using shell.
I was trying to install Valgrind using brew on Yosemite.
Valgrind
brew
brew install --HEAD valgrind<
Looks like a permission issue. I would try doing this
chmod 755 /usr/local/lib/pkgconfig
This should make that available, then try
brew link valgrind
If that doesn't work I would try doing a check on it
brew doctor