Next [of-の] people [with-と] on-good-terms should-do [べき-copula-だ].
~と仲良くする ('to get along well with X') is a common compound construction. 仲良く is the adverbial form of 仲良い ('on good terms'). ~べき closes it as advice in the prescriptive register. A maxim about community harmony.