Nowadays, human indoor localization services inside buildings or on underground streets are in strong demand for various location-based services. Since conventional GPS cannot be used, indoor localization systems using wireless technologies have been extensively studied. Previously, we studied a fingerprint-based indoor localization system using IEEE802.15.4 devices, called FILS15.4, to allow use of inexpensive, tiny, and long-life transmitters. However, due to the narrow channel band and the low transmission power, the link quality indicator (LQI) used for fingerprints easily fluctuates by human movements and other uncontrollable factors. To improve the localization accuracy, FILS15.4 restricts the detection granularity to one room in the field, and adopts multiple fingerprints for one room, considering fluctuated signals, where their values must be properly adjusted. In this paper, we present a fingerprint optimization method for finding the proper fingerprint parameters in FILS15.4 by extending the existing one. As the training phase using the measurement LQI, it iteratively changes fingerprint values to maximize the newly defined score function for the room detecting accuracy. Moreover, it automatically increases the number of fingerprints for a room if the accuracy is not sufficient. For evaluations, we applied the proposed method to the measured LQI data using the FILS15.4 testbed system in the no. 2 Engineering Building at Okayama University. The validation results show that it improves the average detection accuracy (at higher than 97%) by automatically increasing the number of fingerprints and optimizing the values.