Updated script to use Homebrew if available