Generic prices are whatever is charged by the manufacture who produces the product, plus a store mark-up to cover profit + expenses.
Certain pharmacies (Target being one of them) used to have a special program: a list of generic drugs that they chose to offer as $4 (and $10) prescriptions - but it was their choice to offer the (often) deeply discounted prescriptions - typically as loss-leaders. Same thing with the free diabetes medications offered by Giant Eagle, among others, for a number of years. It was a store program - not honoring prices set by someone else. They lost money on those programs, if you only take into account what they made on the sale of those drugs. Their hope was (1) get you into the store and make money off of your purchases that you made there because you were in the store or (2) convince you to bring your other (more profitable) prescriptions over for the convenience of keeping all of your own prescriptions in the same place.
It was a nice program while it lasted, as was the free diabetes meds from Giant Eagle. But discontinuing a program that they were offering at a loss, to start out with, is not a reason to boycott them once they discontinue it. The phase-out a Target is because Target pharmacies are now CVS pharmacies & I don't believe CVS ever had a $4/$10 list of meds.
Try goodrx.com (generally to find discounts on drug stores). You may be able to find a local place that offers the medication at a price closer to what you were paying. If you can stomach Walmart, they apparently still run a $4/$10 program. In my area, Giant Eagle still offers a similar program. Also check: Kmart, Walgreens, and national grocers such as Kroger.