Fixes to get Python working.

These Linux-specific fixes were necessary to get Python/pip installed on my machine.

Apart from these Linux-specific fixes, I also had the problems described in [Homebrew issue #22816](https://github.com/Homebrew/homebrew/issues/22816) and [issue #26900](https://github.com/Homebrew/homebrew/issues/26900). I used the solutions described there, and it sounds like progress is being made on them upstream.