The prime minister has vowed to do "whatever it takes to bring these thugs to justice" as he addressed the nation amid rioting in UK streets.