Optimal control of linear time-lag systems