You can leave all profit in the company and not take distributions. (Note this does not change the fact that the profit is taxable to the shareholders). If the shareholders are working for the business they should get wages.
Like many questions asked here, the answer is that it depends on all the facts and circumstances. Certainly there are cases where IRS would see no problem -- for example, the income was received in one year but was paid out in another, perhaps for capital investments like land that would not show up as an expense on the income statement. And then there are cases where IRS would assert that wages "should" have been paid, but the lack of distributions would make it a difficult proposed assessment to defend. Using common sense, they would probably conclude that there are enough easy cases where "dividends" paid out are in fact wages, that there is no reason to pursue a hard case.