Having warmed up his audience with two hours of bombast and traditional song common to Mozambican political rallies, President Samora Machel, looking like a svelte Fidel Castro without the cigar, decided to send a message to America.

The charismatic leader of Mozambique glanced with scorn at a hapless, tattered group of 56 prisoners, the product of a hidden war supported by South Africa, and then turned from the crowd of about 7,000 people to address the only American reporter within hundreds of miles.

Laughing, poking me playfully in the chest and punching my arm in full view of his bodyguards, Machel said, "So, American, do you think these people can fight the Mozambican Army? Look at them," he added derisively. "Are they the allies of the United States?"

Barefoot and bedraggled, the captured members of the Mozambique National Resistance hardly looked like British commandos or U.S. marines.

Machel's question, however, was not meant to be answered. Rather it was a dig at what he sees as American support for South Africa, which backs the MNR.

The bearded Machel was grandstanding for his audience in his home district in Gaza Province, where until recently MNR raids played havoc with the lives of tens of thousands of people just 200 miles north of Maputo, the capital.

He turned serious, however, when he was asked about U.S. attempts to influence South Africa to stop supporting the MNR. Even though there is no evidence of a South African letup, he told me he was "very satisfied" with the American effort.

The United States, he knows, is the main hope for controlling South Africa, the military and economic giant of the region whose power to destabilize its neighbors obsesses black Africa.

Samora Moises Machel, a 49-year-old former nurse turned revolutionary leader, is fighting for the life of his Marxist government. As leader of one of the world's poorest countries, the best thing he has going for him is his live-wire personality.

Striding the makeshift stage at the recent rally in Chibuto to celebrate the Army's victory over the guerrillas in the province, Machel was a one-man show. Alternating between his native Shangaan language and Portuguese, he effectively raised the political consciousness of his audience, battered by years of war, poverty, drought and underdevelopment.

His phrases often bubbled forth before his translator could finish the previous sentence, but his mood was infectious. The crowd, including many people perched in acacia trees surrounding the open field, loved it as he humorously lectured on the faults of the people, the country and his government.

To an outsider, his method may seem bizarre, but there was no question that he got his point across: the people must demand more of their leaders.

"When the Portuguese colonists told you to clear the road, you cleared," he told his audience, "even though you knew the soldiers would drive down the road to collect taxes and to rape your wife."

"The white man knew how to rule," he added in a litany that soon became familiar. "Now, when you are ordered to clear the road, sometimes you say no, so trucks cannot deliver the goods."

Striding across the stage and waving his arms like a conductor, he bellowed, "The fault is ours because we have the power. We don't know how to rule." Poking fun at the country's Marxist methodology, he added, "We just do a critique."

The crowd roared with laughter. In a rural society where there is no television or entertainment and little to look forward to but the drudgery of finding the next meal, Machel's visit was a piece of theater.

The highlight of the show was the presentation of the pathetic, mostly young, MNR prisoners. Just a few weeks earlier in Gaza Province, seven had been shot by firing squad after hastily staged public trials.

There was no repeat performance, although some of the audience shouted that they should be killed. In Mozambique, it is all part of educating the generally apathetic masses.

For the frightened prisoners, fear did wonders for their education. As Machel raised his fist and shouted, "The struggle continues," the crowd did the same--and so did the prisoners.

For all his ranting and shouting, however, Machel knows his country desperately needs peace if it is to have any chance to emerge from its backwardness.

"The earth hurts when there is no peace," he told the crowd.

Despite his proud marshal's uniform, often accompanied by a holster and pistol, and his bombastic language, Machel has been one of the prime movers for ending hostilities in southern Africa.

British diplomats readily acknowledge that Machel was a key factor in the success of the 1979 negotiations at London's Lancaster House that finally produced majority rule for neighboring Zimbabwe. Machel leaned on his friend Robert Mugabe, then a Mozambique-based guerrilla leader and now prime minister of Zimbabwe, to take part in the negotiations and finally to sign the agreement.

At a crucial point in December 1979 when a breakdown loomed at the last minute, Machel sent a message to Mugabe telling him to sign the agreement, according to involved diplomats. Fearful of British intentions, Mugabe reportedly hesitated, wept and then signed, ending black Africa's bloodiest struggle for independence.

After Mugabe's election, Machel warned him not to emulate Mozambique, where almost all the whites fled at independence, sending the economy into a tailspin. Fewer than 45 percent of the whites have left Zimbabwe in the three years since independence.

As a result of the success at Lancaster House, one of the world's strangest mutual admiration societies has developed between Machel, a fervent Marxist, and British Prime Minister Margaret Thatcher, an ardent foe of communism. Machel is expected to make his first visit to Britain soon.

He told visiting Portuguese President Antonio Eanes, according to a western diplomat, "If I had a daughter I'd name her Margaret."

U.S. diplomats also acknowledge that Machel has been a moderating influence on Angolan President Eduardo dos Santos in the tortuous negotiations over independence for South African-ruled Namibia.

Despite the Reagan administration's antipathy toward Marxist governments, U.S.-Mozambican relations, icy at first, have thawed. Chester Crocker and Frank Wisner, the two senior State Department officials involved in Africa, each visited Maputo for talks with Machel in recent months, and Washington is reportedly moving toward elevating relations to ambassadorial level again.

Machel has been careful, however, not to turn away from his arms supplier, the Soviet Union, with which Mozambique has a friendship treaty. He went to Moscow last month, the first African president to visit the new Soviet leader, Yuri Andropov.

"Mozambique is widening its circle of friends without walking away from its existing relationships," a western diplomat said. But Mozambicans frequently complain about the level and quality of assistance, mainly military, that they get from the Soviets. The aura of Marxist friendship from the time of independence has obviously faded.

The opening to the western nations, particularly the United States, is aimed at getting them to call off the South Africans and thus end the MNR threat. How successful that policy is remains to be seen.

The rally represented the other aspect of Machel's policy: restoring public confidence in the ruling Marxist party, Frelimo, and improving the economy.

"The MNR has found fertile soil in Mozambique because of economic disillusionment with Frelimo," a western diplomat said.

A number of Mozambican officials, sometimes even fervent Marxists, are sharply critical of the system, but they declined to be identified.

"People are fed up with the party bureaucracy," one middle-ranking official said. "What the socialist state did in the first seven years of independence was to make socialist policy ugly. For seven years we have had a kind of megalomania--we try to reinvent the wheel daily," he said, instead of learning from the mistakes of others.

"Mozambican politics start with political ideas completely inappropriate to the situation in which we live," another said. "Mozambique is a huge country with a small population which was 96 percent illiterate at independence. Those facts are far more important than whether the government is communist."

Some of the problems have nothing to do with ideology but are common to Africa, such as giving priority to the cities. "There is a lot of this illness of working in air-conditioned offices," a wealthy Portuguese farmer said.

A foreign businessman who has lived in Maputo for years said, "It is useless to try to do business under this system. I feel like chucking the lot and going. They can have the whole thing--the business, the free houses, the free cars."

The state takeover of the distribution system has often proved disastrous. A western agricultural specialist estimated that there has been a 50 percent drop in availability of consumer goods in rural areas.

Despite the worst drought in 50 years in the south, much of the agricultural problem is not caused by nature, he said, but is man-made, such as poor pricing and distribution policies.

Peasants in the north have refused to sell or sometimes even harvest their bumper crops because of low fixed prices and lack of anything to buy with the money, he said.

He complained that priority is given to inefficient state farms.

Aranda da Silva, the minister of internal commerce, acknowledged the validity of some complaints, saying the state farms receive 80 percent of the government's resources although they represent less than 10 percent of agriculture. Agriculture Minister Sergio Veiera has talked of changing the emphasis to family farms, but the official policy so far is to stick with state farms.

The party has published eight "theses," restating standard Marxist policy, for public discussion in preparation for this month's fourth party congress.

"We have really been shattered by the storm of criticism" over the theses, a top Frelimo official told a western diplomat. He quickly added that the criticism is directed at "improper practices" rather than at Marxist principles. The discontent, however, is manifest.

There is a great deal of self-criticism within the government, unlike in many African countries. Machel is at the forefront in criticizing his own government.

At last month's People's Assembly, the Mozambican equivalent of a parliament, he attacked economists for offering unrealistic plans and inflated targets, saying it was because they avoided rural areas. Last year the government predicted a 35 percent increase for agricultural output and a 24 percent rise for industry, both impossible targets. This year, the forecasts have been reduced to 7 percent, still probably overly optimistic in view of the drought.

There are limits to the criticism, however. Nobody criticizes Machel or the Marxist system itself.

For the South Africans, concerned about the possibility of a successful black government being an example for their powerless black majority, "the situation is ideal," a western diplomat said.

"South Africa is faced with an incompetent Marxist regime," the envoy said. "If I were South African I would want to keep Machel in power as long as possible with his crumbling Marxist economy."