We do not need to understand utility as increasing happiness (and minimizing pain) in a narrow sense. It is probably best to understand “happiness” or “pleasure“ here in a wide sense as „good feeling“. Measuring this could be done with surveys or other scientific methods or by inference from your own experiences etc., i.e. by taking your best intuitive guess.
The target group are all beings able to experience pleasure or pain. When you commit a certain action, the target group to be considered are all beings who are possibly affected feelings-wise by the action.
The overall amount is the maximal utility you can achieve. That is, do the action that seems most probable to increase overall utility. So we sum all the pleasure of all the beings who experience it and subtract all their pain. In classical utilitarianism we do not use the median or mean.
As for the fair distribution of utility or happiness: Yes, this is not directly included in utilitarianism itself, i.e. in the classical version.
In order to possibly make it fit with classical utilitarianism you would have to say that in all possibly realistic situations where unfairness seems to be a problem for classical utilitarianism, it actually isn’t.
For example, often a kind of thought experiment is used to show that classical utilitarianism is incompatible with our intuitions of fairness. So it is supposed to show that classical utiliatrianism is unfair and that this is intuitively problematic.
In this kind of thought experiment you have people who suffer, all to the enjoyment of many others, and that enjoyment is so large that it outweighs (if a number where given to the enjoyment) the overall suffering.
To try to keep up a classical utilitarian view and still respect intuitions of fairness you could suggest that there are in real life other ways for these people to get to their enjoyment without anyone having to suffer, (or at least without anyone having to suffer so much). In this case we are not maximizing utility here by making a part of the people suffer at all (or so much), since there would be a better utilitarian alternative.
Of course we can always create thought experiments that manage to get around such a reply. However, I think that we will have to ask ourselves how useful these thought experiments are for creating a moral theory, if they are so unrealistic that we cannot even imagine them being real anytime now or in the future.
If some realistic one was found, one may be willing to bite the bullet in that thought experiment and accept unequal or otherwise deemed “unfair” distribution of utility/ happiness (we may maybe then no longer want to call it “unfair”). And so classical utilitarianism then could be upheld without it supporting (apparently) unfair action on a large or substantial scale.
Of course, if one does not agree about thought experiments having to be realistic in this way or if one finds a realistic thought experiment where the classical utilitarian would face a situation judged as unfair and unacceptable, the problem would (to some degree) remain.
However and moreover, there are still other ways to deal with the problem. It‘s probably best to look up literature that deals with the aggregation problem in utilitarianism. An other interesting option would be to read up on negative utilitarianism, or suffering-focused ethics (e.g. on the website of the foundational research institute).