Although France (especially) had the means and the motive to support the 1987 coup, there is currently no conclusive evidence of French, US or other Western powers involvement. However, this may change in the coming months as the French President, Emmanuel Macron, recently promised to declassify files relating the death of Thomas Sankara (see update at the end of this answer).
Given that Sankara had alienated much of the local elite and given that the coup leader (Compaore) was highly placed within the Sankara government, it is doubtful if much (or even any) French or American help would have been needed to carry out the coup.
There has, though, been an admission of involvement by former Liberian warlord, now senator, Prince Johnson.
Evidence of direct French or American involvement in the Blaise Compaore-led coup of October 1987 is hard to pin down but there is little doubt that the French were not unhappy at the demise of Thomas Sankara’s regime. However, as Sankara had alienated both the domestic political elite and the unions (a number of prominent union leaders were detained in May 1987), it is doubtful whether Compaore needed any external help in ousting his former friend. Internal divisions were evident, and Sankara’s faction within the ruling Conseil National de la Revolution became increasingly isolated. Most of those in power were not prepared to follow Sankara’s Spartan lifestyle and resented demands such as having to give up part of their salaries to help fund projects for the rural poor.
That said, the French definitely had the means and motive to bring about a regime change if they so wished, and it appears that they intervened in May 1983 when Sankara, then Prime Minister, was detained ‘following a French intervention’ (quoted from G. Martin).
Sankara was determined to combat the adverse effects of neo-colonialism and was very anti-French. France has always had a very favourable trade balance with its former West African colonies and evidence of French economic and cultural influence among the elite is widespread. Any move to lessen those ties was a direct threat to French commercial and political interests.
The political elite of Burkina Faso’s (comparatively) wealthy southern neighbour Ivory Coast were also opposed to the Sankara regime. Of all the former French colonies, the Ivory Coast under its President Felix Houphouet-Boigny had the closest ties to France. By the early 1980s, the Ivorian ‘economic miracle’ of the 1960s and 1970s was over, and discontent at widespread corruption and the lack of political freedom in a one-party state was on the increase. Sankara’s removal of officials’ privileges and attention-grabbing actions, such as selling off the government’s fleet of Mercedes cars and telling officials they would have to make do with the Renault 5, had many Ivorians wondering if some of Sankara’s policies might not be usefully applied to their own pampered officials.
With the radical Jerry Rawlings-led Ghana on its eastern border, the Ivorian government was unhappy at having another revolutionary / radical neighbour to the north. Not surprisingly, the establishment of a political body in August 1986 to plan a political union of Ghana and Burkina Faso did not go down well with other countries (mostly former French colonies) in the region. Further, Sankara’s policies aimed at alleviating poverty (especially in rural areas), if successful in the long-term, would have threatened the supply of the cheap Burkinabe labour needed to work on the coffee and cocoa plantations which were the mainstay of the Ivorian economy.
Compaore, who had married a relative of the Ivorian President Houphouet-Boigny in 1985, reversed almost all of Sankara’s policies when he took over the presidency. The changes were welcomed by both France and Ivory Coast. Commenting on why he overthrew Sankara, Compaore said:
Sankara jeopardised foreign relations with former colonial power
France and with neighbouring Ivory Coast
(from Reuters, 17 Oct 2007)
Of US involvement in the 1987 coup, either direct or indirect, there is little evidence. Sankara’s close ties with Qaddafi amounted to little more than rhetoric, a fact which would not have gone unnoticed by the CIA; in any case, coup leader Compaore was also close to Qaddafi. Also, the US had long sought to weaken French interests in the region so any attempt to remove an anti-western president would have to have been balanced against the fact that the charismatic Sankara was threatening those French interests.
Although Blaise Compaore has long denied being involved in the killing of Sankara, Prince Johnson (currently a senator in Liberia) has implicated himself, former Liberian President Charles Taylor and Compaore in the coup. Johnson was part of a Taylor-led group which arrived in Burkina Faso to plot the overthrow of the Liberian president Samuel Doe. In 2008, in an interview given to AFP and Radio France International, Johnson said:
the second in command, Blaise Compaore, had asked us to help him get
Thomas Sankara out of power....He said this was the only way we could live in Burkina Faso without any threat. And Sankara was killed in the process. We did it because that is the only way we could stay in Burkina and prepare our attack against Doe....Blaise Compaore was everything there. He controlled the military barrack and the special commandos' forces that were in charge of the presidential palace. So it was very easy to penetrate.
In 2015, an international arrest warrant was issued for Compaore by Burkina Faso's military court, charging him with the murder of Thomas Sankara.
In a recent interview (published Jan 2nd, 2019), a lawyer of the Sankara family, Jean-Patrice Yameogo, confirmed receipt of the first batch of documents released by France. While confirming that the documents contained new information, he would not be drawn on French or other countries' involvement but he did confirm foreigners played a role, including Prince Johnson and Charles Taylor. When asked if any specific countries were mentioned, Yameogo replied:
Non, il n’y a pas de noms de pays en tant que tels, mais il y a des
acteurs étrangers comme je viens de le dire.
Translation: No, there are no country names as such, but there are foreign actors as I just said.
He also stated that the documents contained interviews of French nationals who had an 'active part' at the time but there is no suggestion that these individuals were involved in the coup itself. As more documents are expected, Yameogo declined to comment further.
A Political Chronology of Africa (Europa Publications)
Elections in Africa: A Data Handbook (OUP)
African Political Thought by Guy Martin (Palgrave Macmillan)
Processed Food Marketing in Ivory Coast 1956-1990: Distribution Techniques and Foreign Domination in a Developing Economy. by Lars Boe Bosteen (PhD thesis)
Historical Dictionary of Burkina Faso (Scarecrow Press)
Compaore and the murder of Sankara
New York Times report on 1987 coup
Some of the above is also based on things I observed, read and / or heard while living and working in the Ivory Coast from 1983 to 1987, during which time I also visited Ghana and Burkina Faso several times. I was actually in transit at the airport in the capital, Ouagadougou, at the time Sankara staged his coup in August 1983