I think you mean $\gcd(L_1,L_2) \mid q$? It is clear that if $\gcd(L_1,L_2) \nmid q$, then no solution can exist, as all the amounts of water moved around are divisible by $\gcd(L_1, L_2)$. I shall also prove that if $L_2>q$, no solution can exist.
Indeed suppose $L_2>q$, and we assume without loss of generality that a solution exists. There are 2 possible operations.
- Choose a non-empty bucket $A$, and a bucket $B$ which isn't full, and pouring water from $A$ to $B$ till either $A$ is empty or $B$ is full.
- Choose a non-empty bucket $A$, and give all of its contents to 1 of the $p$ people.
Let $m$ be the number of buckets with $>q$ litres of water in them, at that point in time. (so $m$ changes as we make moves) Note that $m$ can decrease by at most 1 at each turn. Since we start at $m=n$ (all big buckets have $L_1>q$), and end at $m=0$ (all water distributed), there must be a move taking us from $m=1$ to $m=0$. Suppose that just before that move, bucket $P$ is the only bucket with $>q$ litres of water. In order for $m$ to become $0$, we must perform an operation involving $P$. It is clear that we cannot perform operation $2$, as that would lead to one of the $p$ people getting $>q$ litres of water. Thus we must have performed operation $1$, by pouring water from $P$ to another bucket $Q$. If we pour till $P$ is empty, then now bucket $Q$ has $>q$ litres of water, contradicting $m=0$. If we pour till $Q$ is full, then obviously bucket $Q$ has $\geq L_2>q$ litres of water, contradicting $m=0$.
Thus there can never be a move bringing us from $m=1$ to $m=0$, so no solution exists when $L_2>q$.
Now let us consider the special case $N=1$, so $L_1=pq$, $p \geq 2$. We have a solution if and only if $L_2 \mid q$. It is easy to see that a solution exists when $L_2 \mid q$ (just keep pouring water into the small bucket for distribution.
For the converse, note that if $L_2 \nmid q$, we can never finish distributing $q$ litres of water by just giving $L_2$ litres of water at a time. If we call a transfer of water using operation $2$ which transferred $\not =L_2$ litres as a special transfer, then we must have at least $p \geq 2$ special transfers.
We show that we can treat all special transfers as from operation $2$ applied to the big bucket. Note that the only way for the small bucket to be partially full at any point in time is by pouring water from the big bucket till the big bucket is empty (If we perform operation $2$ on the small bucket it would be empty) But in that case, if we had performed operation $2$ on the small bucket to get a special transfer, we can equivalently pour all the water in the small bucket into the big bucket and perform operation $2$ on the big bucket instead.
Consider the situation right after we had made the first special transfer. Then by the above argument we can treat it as having resulted from operation $2$ on the big bucket, so the big bucket is now empty. Consider the situation just before the special transfer. Then at that time, the big bucket has some water, so by above the small bucket must be either empty or full by the above argument. Now let's return to the point in time after the special transfer. Now the big bucket is empty and the small bucket is either empty ($0$ litres) or full ($L_2$ litres). It is clearly now impossible to make any more special transfers, so at most $1$ special transfer has been made, contradicting the fact that we need at least $p \geq 2$ such transfers.