Let $b_1,b_2,b_3,...$ be an infinite sequence of linearly independent elements of $M$, scaled so that
$$|b_n| < \frac{1}{n}$$
for all n.
Extend $\{b_1,b_2,b_3,...\}$ to a basis $B$ of $M$.
Define $f:M\to K$ by
$$f(x) = \sum_{n=1}^{\infty} x_n$$
where $x_n$ is the coefficient of $x$ with respect to the basis element $b_n$.
Note that for each $x \in M$, only finitely many of $x_1,x_2,x_3,...$ are nonzero, so the summation for each $f(x)$ is effectively just a finite sum.
Then $f$ is a linear functional, but $f$ is not continuous, since ${\displaystyle{\lim_{n \to \infty}b_n = 0}}$, but $f(b_n) = 1$, for all $n$.