This work extends the existing static framework for joint flow control, routing and medium access control (MAC) in random access multi-hop wireless networks to a dynamic framework where link capacities vary over time. The overall problem is formulated as a long term network utility maximization (NUM) problem (instead of the existing static NUM problem) that accounts for link capacity variation. This dynamic formulation is more realistic than the static one, and is one step closer to practical networks. Under the stationary and ergodic assumptions on the link capacity variation, the problem is decomposed to form a distributed algorithm. The algorithm samples current link capacities while it is iteratively and locally updating flow rates and link transmission probabilities. Simulation results demonstrate the ability of the algorithm to sustain the optimal average data rates despite the link capacity variation.