The Internet of Things (IoT) unleashes great opportunities to improve our way of living and working through a seamless and highly dynamic cooperation among heterogeneous things including both computer-based systems and physical objects. However, properly dealing with the design, development, deployment and runtime management of IoT applications means to provide solutions for a multitude of challenges related to intelligent distributed systems within the IoT. In this paper we propose Model-Driven Engineering (MDE) as a key enabler for applications running on intelligent distributed loT systems. MDE helps in tackling challenges and supporting the lifecycle of such systems. Specifically, we introduce MDE4IoT, an MDE approach enabling the modelling of things and supporting intelligence as self-adaptation of Emergent Configurations in the IoT. Moreover, we show how MDE, and in particular MDE4IoT, can help in tackling several challenges by providing the Smart Street Lights concrete case.