How do I get to know/work with academics during my master's degree? I am in my first year of my master's degree in Europe, and within a year or so I'll have to be sending out applications for a PhD (always in Europe), for which I need 2 to 3 recommendation letters. This is a huge issue  for me because I pretty much don't know anyone inside academia.

Recommendation letters should be written from people inside academia who know you, which I suppose means they worked with you on something.  The only person I worked with was my bachelor's thesis advisor, but I changed institution for my master's degree so I'm not in contact with him anymore. I also need to complete a thesis (equivalent to a semester of full work) for my master's degree, so I will have another thesis advisor eventually, but by the time I can start working on my thesis I will already have to be sending out PhD applications. Is it possible to work with academics in other ways than writing a thesis? Or is it otherwise possible to have an academic know you to the point of being able of writing a reference letter, without necessarily having worked with you?

Anyway this is not just a matter of recommendation letters. I think that having people in academia know and recognize me would give me better chances in getting admitted to a good PhD program. Moreover, it's nice to have someone to ask for advice when you need it. 

I think for people who are already into their PhD it's easier, since at least you're put inside a research group and have your own advisor. But as a master's degree student I don't feel like I have many opportunities to establish contact with academics.
Since you appear to be in Italy – actually a fellow citizen! – I'll try to give an answer from an Italian perspective. As a master's student, you usually have three possibilities to work with professors:


start working on your master's thesis;
apply for a teaching assistant position for one of the classes;
do an internship.


For what concerns possibilities 2 and 3, these may be available or not depending on university, field, year etc. For instance, I have TAs from both bachelor's and master's levels and I'd be happy to provide recommendation letters for them, as I did for others in the past.

If none of the above work for you, you can try asking professors whose classes you attended, getting top grades. In this case, however, they might not be willing to provide a recommendation letter. In fact, up to a few years ago, I wasn't willing either, as I explained in this answer. Nowadays, I accept (even though I don't approve of this practice) that recommendation letters are required almost everywhere, and I'm more willing to provide recommendation letters to students who attended my classes and somehow positively caught my attention (at the exam, through in-class questions, during office hours).