Fixed makefile for Windows.
Changed access properties.
Delete file object if error on opening.