Sometimes we need to interpret scriptures based on context. The very next verse says the above given duties are duties at the time of distress.
एते चतुर्णां वर्णानामापद्धर्माः प्रकीर्तिताः ।
यान् सम्यगनुतिष्ठन्तो
व्रजन्ति परमं गतिम् ॥ १३० ॥
The duties of the four castes (varna) in times of distress have thus
been declared, and if they perform them well, they will reach the most
blessed state.(130)
Also prohibiting to amass wealth doesn't necessarily mean not allowed to have wealth at all. This means only stockpiling of wealth is prohibited. Even Brahmins are not allowed to stockpile wealth which vaishyas alone can do.
If a Brahmana happens to have more wealth than what is necessary for
maintaining himself and his family for three years, he should with
that wealth perform sacrifices. A Brahmana should never acquire wealth
for nothing.
[Mahabharata Book 13 Chapter 47]
Several other verses in the Manusmriti may indicate that even Shudras can earn money and wealth. In the very same chapter,
विद्या शिल्पं भृतिः सेवा गोरक्ष्यं विपणिः कृषिः ।
धृतिर्भैक्षं कुसीदं
च दश जीवनहेतवः ॥ ११६ ॥
Learning, handicrafts, working on hire, service, cattle-tending,
trade, agriculture, contentment, begging and money-lending,—these are
the ten means of livelihood.—(116)
Medhātithi writes:
This verse sets forth the means of livelihood for all men, during
times of distress.
‘Learning’—here stands for sciences other than the Veda; such, for
instance, as Medicine, Logic, Physics, Toxicology and so forth,—all
which are not reprehensible, when used as a means of livelihood.
‘Handicraft.’—This has been already explained.
‘Working on hire’—as a servant
‘Service’—acting according to the wishes of another person.
‘Contentment’—This has been added only by way of illustration.
The meaning of this verse is that in the absence of the particular
means of livelihood specifically assigned to each caste, these ten
means are open to all men.—(116)
Also one more verse:
कृष्णसारस्तु चरति मृगो यत्र स्वभावतः ।स ज्ञेयो यज्ञियो देशो
म्लेच्छदेशस्त्वतः परः ॥
एतान्द्विजातयो देशान् संश्रयेरन् प्रयत्नतः
।शूद्रस्तु यस्मिन् कस्मिन् वा निवसेद् वृत्तिकर्शितः ॥ (Manu II.23-24)
But the region where the spotted deer roams by nature is to be known as the ‘land fit for sacrificial acts’; beyond that is the ‘land op the Mlecchas. The twice-born people should seek to resort to these countries; the Śūdra may however, when distressed for a living, reside in any land.
Medatithi writes:
In as much as service of the twice-born people constitutes the
prescribed duty of the śūdra, it follows as a matter of course that
the latter should reside where the former reside; but if he fails to
obtain a living in that country, then he may go. and live in another
country; this is what is permitted (in the latter part of the verse).
When the man comes to have a large family, or becomes unfit for
service,—even though the twice-born person on whom he is dependent may
be prepared to support him,—the śūdra may go and live in another
country, where there may be a chance for him to acquire wealth.