Optimal control in a linear macroeconomic model with random coefficients