In this paper we investigate the sources of instability in credit and financial systems and the effect of credit linkages on the macroeconomic activity. By developing an agent-based model, we analyze the evolving dynamics of the economy as a complex, adaptive and interactive system, which allows us to explain some key elements occurred during the recent economic and financial crisis. In particular, we study the repercussions of inter-bank connectivity on agents' performances, bankruptcy waves and business cycle fluctuations. Interbank linkages, in fact, let participants share risk but also creates a potential for one bank's crisis to spread through the network. The purpose of the model is, therefore, to build up the dependence among agents at the micro-level and to estimate their impact on the macro stability.