Should I give up on pursuing a PhD in Europe if I performed poorly in my master?
Anecdotal answer: I did pretty horribly in my first higher-level, bachelors mathematics courses, partly for health reasons and partly because I had never been challenged like that before.  I also performed horribly the first year of graduate school (equivalent to first year of masters in Europe).  I had to learn (not re-learn, but learn for the first time) basic proof techniques in analysis.  Not only did I eventually get a PhD, but also subsequent postdocs, and I have a growing number of publications.  Some of us just start off a bit behind and have to work harder to catch up.

At the same time, academia isn't the only place to do research.  There are many research-like positions in industry.  If research is your goal, do research.  You don't need a PhD to do research (but it can help in some cases).