I'm a bit confused about bayesian networks when in a situation like the one in the figure below section 4, we want to compute $P(M)$ given the probability tables:
Now, if I understand it right the probability of $M$ is just the joint probability : $P(M) = P(M| G, S)P(G)P(S)$ = $0.90 \cdot 0.20 \cdot 0.90$
Is that right? or should I sum of all entries of the table $P(M|G, S) $
Thank you !

You should use the total law of probability to consider all cases.
$$P(M)=\sum_{s,g} P(M|G=g,S=s)P(G=g)P(S=s)$$