US authorities have accused an 18-year-old of planning to carry out an Islamic State-inspired attack using knives and hammers on New Year's Eve.