As for the people, he made servants of them from one end of Egypt to the other.
Genesis 47:21

The Egyptians weren't enslaved by Joseph but by their own ignorance and lack of faith. They could have set aside much for themselves during the seven years of plenty if they had truly believed God's message to Pharaoh, but instead they relied solely on Pharaoh and Joseph to take care of the future.

If you treat the government like it is your master, it will happily oblige you.