President Cyril Ramaphosa has declared war against gangsters, construction mafias and extortionists, commending police who killed criminals in a shoot-out.