Higher-derivative gauge field terms in the M-theory action