We consider a two-stage make-to-order manufacturing system with random demands, processing times, and distributed customer due dates. The work to each stage is released based on a planned lead time. A general approach to minimize total inventory holding and customer order tardiness cost is presented to find the optimal manufacturing capacities and planned lead times for each manufacturing stage. Expressions are derived for work-in process inventories, finished-goods-inventory and expected backorders under the assumption of a series of M/M/1 queuing systems and exponentially distributed customer required lead times. We prove that the distribution of customer required lead time has no influence on the optimal planned lead times whenever capacity is predefined but it influences the optimal capacity to invest into. For the simultaneous optimization of capacity and planned lead times we present a numerical study that shows that only marginal cost decreases can be gained by setting a planned lead time for the upstream stage and that a considerable cost penalty is incurred if capacity and planned lead time optimization are performed sequentially.