Find libmagic installed with brew on OSX in non-standard prefix

I - and probably other users of brew - use a custom prefix.  Teach
python-magic to ask brew what the prefix is and look there as well.

I tried the approach described in the references below but it did not
work for me:
  https://stackoverflow.com/questions/22483824/how-to-get-python-to-load-right-library-a-dylib-not-so-3-on-osx/22486117#22486117
  http://notmuchmail.org/pipermail/notmuch/2013/015424.html
  http://git.notmuchmail.org/git/notmuch/blobdiff/b60fb3309cca82dd2789f45ad9cccaacdc291089..acb079e35726cc421b6a314ab4f26d5eb92feaf1:/bindings/python/notmuch/globals.py