Copied from my answer at SuperUser:
This isn't so much of a solution as a workaround, but I'm currently trying the (open source) MiddleClick app which adds middle-click functionality all across the system by triggering a middle-click when you do a three-finger-tap.
The only problems are that you can press middle-click accidentally by touching three fingers on the trackpad every now and then, which has been somewhat annoying. There are also obviously the system trackpad bindings (e.g.,
App Expose or
Mission Control) that can conflict with the three-finger-tap if you don't make the corresponding scrolling motion pronounced enough. You could probably fix these conflicts by tweaking the sources, as it appears that there are no settings in the running app itself.
You can install MiddleClick via homebrew as well:
brew cask install middleclick
It turns out that the three-finger-tap behavior of MiddleClick is rather annoying and unusable, for me at least. Also, trying to modify the sources for better behavior proved to be more trouble than it's worth, as MiddleClick makes use of
MultitouchSupport.framework, which is private and requires reverse-engineering to make sense of its functions' parameters. Unfortunately, I don't have time for that right now, esp. over something so basic. However, I did find BetterTouchTool which implements the same basic functionality but provides much more customizability. It's not free, but it's only $3 and moreover it works fine with the Magic Trackpad 2, which can't be said for the similar app that I also tried, MagicPrefs.
BetterTouchTool can also be installed via homebrew:
brew cask info bettertouchtool