Microscopic black hole entropy in theories with higher derivatives