- join a group of squatters (hopefully you already know someone) until you get your bearings. The less ideological ones often squat old industrial properties, or long-abandoned houses (its rough in winter, but in Portugal you should be fine). You might meet some Urbex guys, they're nice and always fine with finding squatters.
- Live in a "big enough" car. You absolutely need to rest on a completely flat surface. I knew someone who got the back seats down and put a wooden plank on it. If you're less than 1.80 and don't move on your sleep, you have a lot of choice (the diagonal is nice), else it might be a bit more expensive.
A very short-term solution is squatting with a close friend, but you shouldn't abuse it too much, it strains relationships.