Fixed compilation with python bindings

Hopefully this should fix #24923.

This is what I used to fix the compilation. This is was inspired by this [Portfile](https://trac.macports.org/browser/trunk/dports/net/libtorrent-rasterbar/Portfile).

It worked using that sequence:
```
brew install python
brew install boost --build-from-source
brew install libtorrent-rasterbar
```

I think that if you want to use the unbrewed python, you can just use boost without building from source and essentially just rely on the brew dependencies. You also shouldn't need the ```PYTHON_EXTRA_LDFLAGS```. Could we make that conditional to the type of python used?

Also, I suppose we should somehow make an option on the formula to build with or without python bindings. Something like ```--with-python-binding``` ?