The $40k price is the current price in the USA.
Generics aren't possible in markets where the patent holder enforces their rights. The article is about how Gilead will allow certain poverty ridden countries to access the drug without the need to pay a licensing cost (i.e. they can receive a "generic").