How to check if permissions for /usr/local, /usr/local/bin, /usr/share/man/man1 have been altered, and how to restore them?

That is a bug in the makefile. The directory for the man files is hard coded incorrectly.

The top is correct

BINDIR=${prefix}/bin
MAN=tree.1
MANDIR=${prefix}/man/man1

Unfortunately the OSX bit hard codes MANDIR you need to edit that line to the one above.

I would note this is not a good makefile - as things like MANDIR and BINDIR are set in several places. These should be set at the end of the configuration and the OSX bit just sets prefix and the compiler options (or perhaps better all installs should be with PREFIX=/usr/local for all Unix OS).

Now reading the details of the link it is worse - the original author of the source code got it correct but the hacks to make it build are wrong. The correct way is in a comment in the answer

Well, this technically works. But it’s invasive. So you could probably run ./configure --prefix=/usr/local before running make and make install and it would achieve the same results.

I have not tried this so can't be certain it works - I would use Macports (or Homebrew) where someone else has already done the hard work of portting the build to macOS and also they provide a binary so you don't even need to compile it yourself. Macports also keeps the directory permissions as they should be for Unix (Homebrew does require some messing around with directory permissions but just /usr/local )

As for chnages to the file system re permissions etc. Thje security is working and you made no chnages. macOS stopped the only commands that change permissions chmod

To check run ls -ld directory for any directory you might be worried about.