redhat/Makefile: fix and clean up some of the logic (v2)
Since !2892 (merged) was buggy and had to be reverted, this is a second attempt, hopefully correct this time.
Since !2892 (merged) was buggy and had to be reverted, this is a second attempt, hopefully correct this time.