Australia's prime minister has given a national apology to survivors of the thalidomide scandal and their families.