Some thoughts about the effect of coalitions. Assuming that the players are a priori indistinguishable, since at every toss at most $\frac{N-1}2 $ of them can gain, the maximum total average payoff is $p \frac{N-1}2 $. An optimal strategy for a player, in whatever sense, is also optimal for every other one by symmetry, so the optimal rational average payoff one can hope is $p \frac{N-1}{2N} $ (here “rational” means: “assuming rational behaviour of opponents”).
If players can communicate, the evil coalition of players $P_1,\dots, P_{N-1}$ against player $P_N$, as said, is betting $\big( \frac{N-1}2 \text{ Heads}, \frac{N-1}2\text{ Tails}\big)$ every time, so that $P_N$ can do nothing but placing as bet Heads every time by revenge, so that the average total payoff of the others is minimised to $(1-p) \frac{N-1}2$.
However, in a less realistic world, players $P_1,\dots, P_{N-1}$ may agree that each of them bets, cyclically with period $N$, Heads $\frac{N-1}2$ times and Tails $\frac{N+1}2$ times, in such a way that the corresponding total wager placed among them $N-1$, is $\big( \frac{N-1}2 \text{ Heads}, \frac{N-1}2\text{ Tails}\big)$ for $\frac{N+1}2 $ times, and $\big(\frac{N-3}2 \text{ Heads}, \frac{N+1}2 \text{Tails}\big )$ for the remaining $\frac{N-1}2 $ times, and present the scheme to the last player $P_N$. This way $P_N$ can win nothing for $\frac{N+1}2$ times out of $N$, but has the opportunity of betting Heads for the remaining $\frac{N-1}2 $, ensuring the optimal rational average payoff of $p\frac{N-1}{2N}$ to everybody. In exchange, $P_N$ should only agree to bet Tail in the remaining $\frac{N+1}2$ times out of $N$, which in any case are already lost for him/her. If $P_N$ does not agree, the coalition may pass to the evil strategy against him/her in retaliation.