Fix include dir for homebrew and properly compile dynamic library.